HOW I SAVE/FREE

When you have added to a hash table, you would more and likely wish to save that information. Well the /hsave command is what you want to use.

I use a alias to save to hash table and an example is below

alias system.update { hsave -o system $+(",$scriptdirhashtables\system.hsh,") }

You would have seen the system.update alias listed in previous pieces of code i showed in other sections. This is it above and something i generally advise, is everytime you add something new to a hash table, always have a alias that saves the hash table as well.

The above code obviouslly saves the new information to the system.hsh table found in the hashtables folder. I'm sure you have already read the make/load hash table section and will already know about the use of $scriptdir and $+(",,")

The -o switch is needed everytime you save to a hash table, well in my opionion it is. As this switch overwrites the previous information stored in the hash table.

Now you may wish to free the information from mIRC's memory after you have used the data for whatever, this really depends on what your using the hash table for. With the above table in my example in mind here. This is basically my variables hash table, so i have this loaded all the time in my own script as its used alot threwout my script. Hense i only free the hash table when you shutdown the script.

But in other areas of my script, where i have hash tables that aren't used as much, i do use the /hfree command to free the information from memory. In the example below ive added the hfree line to the above example and shown how i would free the table if i wished to .

alias system.update { hsave -o system $+(",$scriptdirhashtables\system.hsh,") | hfree system }

Not much to it really, just a simple command to free the system hash table.